/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package session03;

import java.io.FileOutputStream;
import java.io.IOException;
import java.io.ObjectOutputStream;
import java.util.logging.Level;
import java.util.logging.Logger;

/**
 *
 * @author macbookpro
 */
public class AccountWriter {
    public static void main(String[] args) {
        
        ObjectOutputStream oos = null;
        try {
            Account a = new Account("abc", 12000);
            oos = new ObjectOutputStream(new FileOutputStream("Account.dat"));
            oos.writeObject(a);
        } catch (IOException ex) {
            Logger.getLogger(AccountWriter.class.getName()).log(Level.SEVERE, null, ex);
        } finally {
            try {
                oos.close();
            } catch (IOException ex) {
                Logger.getLogger(AccountWriter.class.getName()).log(Level.SEVERE, null, ex);
            }
        }
    }
    
}
